<template>
	<view class="main-content">
		<scroll-view scroll-y class="list-box">
			<text class="title">{{entInfo.entName}}</text>
			<view v-for="(item,index) in architectureList" :key="index" class="list-item">
				<view class="info">
					<text class="name">{{item.userName}}</text>
					<text class="role">{{item.job}}</text>
				</view>
				<text class="phone">{{item.phone}}</text>
			</view>
		</scroll-view>
		<!-- <you-bottom-btn :btnConfig="bottomBtnConfig" @formSubmit="formSubmit">
		</you-bottom-btn> -->
	</view>
</template>

<script>
	import Mine from '@/api/mine.js'
	export default {
		data() {
			return {
				scrollHeight: '',
				architectureList: [],
				entInfo: {},
				bottomBtnConfig: [{
					text: '	新增',
					class: 'confirm',
					funcName: 'formSubmit'
				}],
			}
		},
		onLoad(e) {
			console.log(e)
			console.log("0000000")
			this.entInfo = e;
			this.getArchitectures();
		},
		onShow() {
			this.getArchitectures();
		},
		methods: {
			getArchitectures() {
				Mine.getArchitectureList({
					entAuthId: this.entInfo.entId || ''
				}).then(res => {
					console.log(res);
					if (res.code == 200) {
						let list = res.data.wbEnterpriseArchitectureList || [];
						this.architectureList = list.map(ele => {
							return {
								userName: ele.userName,
								phone: ele.phone,
								job: ele.job
							}
						})
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}

				})
			},
			formSubmit() {
				uni.navigateTo({
					url: '/subPages/mine/compent/addPersonnelRecords?maintainCompanyId=' 
					+ this.entInfo.maintainCompanyId+'&entAuthId='+this.entInfo.entId+'&entName='+this.entInfo.entName
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.main-content {
		width: 100%;
		height: 100%;

		.list-box {
			padding: 20rpx 30rpx;
			background: #ffffff;
			height: 100vh;
			box-sizing: border-box;

			.title {
				display: block;
				font-family: "PingFang SC";
				font-size: 30rpx;
				font-style: normal;
				font-weight: 400;
				line-height: 40rpx;
				opacity: 0.5;
				padding: 20rpx 0;
			}

			.list-item {
				display: flex;
				justify-content: space-between;
				padding: 30rpx 0;

				.info {
					font-family: "PingFang SC";
					font-size: 28rpx;
					font-style: normal;
					font-weight: 500;
					line-height: 40rpx;
				}

				.role {
					color: #325ef5;
					text-align: center;
					font-family: "PingFang SC";
					font-size: 22rpx;
					font-style: normal;
					font-weight: 400;
					line-height: 22rpx;
					padding: 5rpx 14rpx;
					background: #ebeffe;
					margin-left: 12rpx;
				}
			}
		}
	}
</style>